<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateTemplateMessagesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('template_messages', function (Blueprint $table) {
            $table->id()->comment('消息模板');
            $table->string('template_id',100)->comment('模板id');
            $table->integer('system_admin_id')->comment('管理员id');
            $table->string('type',30)->comment('类型 sub_message(订阅消息)  temp_message(微信模板消息)');
            $table->char('template_key',50)->comment('模板编号');
            $table->char('name',100)->comment('模板名');
            $table->string('content')->comment('回复内容');
            $table->tinyInteger('status')->default(1)->comment('状态 0禁用 1正常');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('template_messages');
    }
}
